<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <!-- 只出现一次的数字 -->
    <script>
      let once = function (nums) {
        let res = 0
        for (let num of nums) {
          //运用了异或符 ^ 进行位运算
          res ^= num
        }
        return res
      }
      console.log(once((nums = [1, 2, 1, 3, 2, 5])))
    </script>
  </body>
</html>
